home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / clang / fgl105c.zip / 10-01.C < prev    next >
Text File  |  1991-05-05  |  690b  |  32 lines

  1. main()
  2. {
  3.    int new_mode, old_mode;
  4.    int x;
  5.  
  6.    /* initialize the video environment */
  7.  
  8.    new_mode = fg_bestmode(320,200,1);
  9.    if (new_mode < 0 || new_mode == 12) {
  10.       printf("This program requires a 320 ");
  11.       printf("x 200 color graphics mode.\n");
  12.       exit();
  13.       }
  14.    old_mode = fg_getmode();
  15.    fg_setmode(new_mode);
  16.  
  17.    /* move the object across the screen */
  18.  
  19.    for (x = -20; x < 320; x+=5) {
  20.       fg_setcolor(10);
  21.       fg_clprect(x,x+19,95,104);
  22.       fg_waitfor(1);
  23.       fg_setcolor(0);
  24.       fg_clprect(x,x+19,95,104);
  25.       }
  26.  
  27.    /* restore the original video mode and return to DOS */
  28.  
  29.    fg_setmode(old_mode);
  30.    fg_reset();
  31. }
  32.